<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterAddPlatformTypeWaller extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mybank_wallet_record', function (Blueprint $table) {
            $table->unsignedTinyInteger('platformType')->default(0)->after('transType')->comment('平台类型 0 默认 1网商 2夸父收银 3饿了么 4美团');
            $table->unsignedTinyInteger('recordIdType')->default(0)->after('transType')->comment('记录ID的类型 1 协议代扣 2 余额解冻记录 3外卖提现记录 ID');
            $table->unsignedBigInteger('recordId')->default(0)->after('transId')->comment('记录 ID');

            $table->index('recordId', 'idx_recordId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mybank_wallet_record', function (Blueprint $table) {
            $table->dropColumn('platformType');
            $table->dropColumn('recordIdType');
            $table->dropColumn('recordId');
        });
    }
}
